package com.budwk.app.sqfwDoc.controller;

import com.budwk.app.sqfwDoc.dto.SqfwTemplateHistoryQueryDTO;
import com.budwk.app.sqfwDoc.service.SqfwTemplateHistoryService;
import com.budwk.app.sqfwDoc.vo.SqfwTemplateHistoryVO;
import com.budwk.starter.common.openapi.annotation.ApiDefinition;
import com.budwk.starter.common.openapi.annotation.ApiOperation;
import com.budwk.starter.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import java.util.List;

/**
 * @author ZY.Wang
 * @since 2023/12/13
 */
@IocBean
@At("/platform/sqfw/sqfwTemplateHistory")
@ApiDefinition(tag = "社区模板历史")
@Slf4j
public class SqfwTemplateHistoryController {

    @Inject
    private SqfwTemplateHistoryService sqfwTemplateHistoryService;

    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "根据条件查询模板历史")
    public Result<?> listTemplateHistory(@Param("..") SqfwTemplateHistoryQueryDTO sqfwTemplateHistoryQueryDTO) {
        List<SqfwTemplateHistoryVO> list = sqfwTemplateHistoryService.listTemplateHistory(sqfwTemplateHistoryQueryDTO);
        return Result.data(list);
    }
}
